<?php
/**
 *      [迷你云] (C)2009-2012 南京恒为网络科技.
 *   软件仅供研究与学习使用，如需商用，请访问www.miniyun.cn获得授权
 * 
 */
?>
<?php

class ThumbnailController extends CUserController {
    public static $thumbSize = array(
        "small" => array("width"=>48,"height"=>48,"default" => "/statics/images/file.png"),
        "normal" => array("width"=>80,"height"=>80,"default" => "/statics/web/images/main/thumb/image.gif"),
        "large"  => array("width"=>128,"height"=>128, "default" => "/statics/web/images/main/thumb_large/image.gif"),
    );
    
    public function actionIndex() {
                $user = Yii::app()->session["user"];
        $userId = $user["id"];
        $size  = Yii::app()->request->getParam('size','-1');
        $tid   = Yii::app()->request->getParam('tid','-1');         
        $thumbnail = new Thumbnail();
        $thumbnail->handleCache();         $thumbnail->_userId = $userId;
        $thumbnail->fileId  = $tid;
        $px = self::$thumbSize[$size];
        if ($px) {
            $thumbnail->width  = $px["width"];
            $thumbnail->height = $px["height"];
            $thumbnail->default = $px["default"];
        }
        $thumbnail->invoke(FALSE);
    }
    
    public function actionSubmitGps(){
    	$user = Yii::app()->session["user"];
    	$user_id = $user["id"];
    	    	    
    	    	$fileHandle = new AlbumList();
    	$fileList=$fileHandle->obtainImage($user_id);
    	 
    	    	    	    	    	    	    	    	    	    	    	    	    	    	echo "获取图片的gps信息并提交至数据库";
    	    	    	    	    	    	    	    	    	    	    	    	    	    	    	    }
    public function actionObtainGpsInfos(){
    	$user = Yii::app()->session["user"];
    	$user_id = $user["id"];
    	$fileHandle=new AlbumList();
    	$gps_a=$fileHandle->getGpsInfos($user_id);
    	echo '<pre>';
    	print_r($gps_a);
    	echo '见附件减肥';
    	    
    }
    
}
?>